Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix buggy behaviour on fast enter to split blocks #10328

Closed
wants to merge 1 commit into from

Conversation

ellatrix
Copy link
Member

@ellatrix ellatrix commented Oct 4, 2018

Description

WIP: this relies on #10297!
Also note that this fixes a bug that existed long before the new rich text value!

Fixes #6021. In master, keep enter pressed in a paragraph, and observe blocks with too many BR elements, or nested paragraph elements, or BR elements around existing text. This is caused by attaching the keydown handler too late (during TinyMCE setup), resulting in default browser behaviour executing. The solution is to attach handler on the content editable element with React as soon as the element is created.

How has this been tested?

When keeping enter pressed in a paragraph, it should create a bunch a clean, empty paragraphs.

Screenshots

Types of changes

Checklist:

  • My code is tested.
  • My code follows the WordPress code style.
  • My code follows the accessibility standards.
  • My code has proper inline documentation.

@ellatrix ellatrix added [Status] In Progress Tracking issues with work in progress [Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable labels Oct 15, 2018
@ellatrix
Copy link
Member Author

New PR: #11287.

@ellatrix ellatrix closed this Oct 31, 2018
@ellatrix ellatrix deleted the try/fast-enter-fix branch October 31, 2018 08:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
[Feature] Rich Text Related to the Rich Text component that allows developers to render a contenteditable [Status] In Progress Tracking issues with work in progress
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Warning on pressing ENTER fast
1 participant